<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ page import="com.msmall.base.util.ConstantDB" language="java"%>
<c:set var="AVALIABLE" value="<%=ConstantDB.AVALIABLE%>"></c:set>
<c:set var="UNAVALIABLE" value="<%=ConstantDB.UNAVALIABLE%>"></c:set>

<script type="text/javascript">
function toUpdate(){
	var array = [];
	var url = "<c:url value='/admin/dpt/updateDepartment.do' />";
	sns.toUpdate(url, array, 'ck_departments','departmentid');
}
</script>
<div class="bu">
<button onclick="location.href='<c:url value="/admin/dpt/createDepartment.do"/>'" class="btn3_mouseout" onmouseover="this.className='btn3_mouseover'"
onmouseout="this.className='btn3_mouseout'" onmousedown="this.className='btn3_mousedown'"
onmouseup="this.className='btn3_mouseup'" title="Create"><fmt:message key="common.create"/></button>&nbsp;&nbsp;
<button onclick="toUpdate()" class="btn3_mouseout" onmouseover="this.className='btn3_mouseover'"
onmouseout="this.className='btn3_mouseout'" onmousedown="this.className='btn3_mousedown'"
onmouseup="this.className='btn3_mouseup'"title="UPDATE"><fmt:message key="common.update"/></button>&nbsp;&nbsp;
</div>
<div>
<table id="t_department_list" width="100%"  border="0" cellpadding="0" cellspacing="0" class="pub_list01">
	<thead>
		<tr>
			<th width="50px" class="tdCenter">
			</th>
			<th width="75px" class="tdCenter">栏目名称</th>
			<th width="75px" class="tdCenter">父栏目名称</th>
			<th width="75px" class="tdCenter">是否可用</th>
			<th width="45px" class="tdCenter">显示顺序</th>
		</tr>
	</thead>
	<tbody>
		<c:forEach var="department" items="${page.items}" varStatus="status">
		<tr>
			<td class="tdCenter">
				<input type="checkbox" name="ck_departments" id="ck_<c:out value='${department.departmentid}' />" value="${department.departmentid}"></input>
			</td>
			<td class="tdCenter">
				<c:out value="${department.title}"></c:out>
			</td>
			<td class="tdCenter">
				<ms:dpt type="dpt" property="${department.parentid}" action="name"></ms:dpt>
			</td>
			<td class="tdCenter">
				<c:choose>
					<c:when test="${department.enabled == AVALIABLE}">
						<fmt:message key="common.enabled"/>
					</c:when>
					<c:otherwise>
						<fmt:message key="common.notenabled"/>
					</c:otherwise>
				</c:choose>
			</td>
			<td class="tdCenter">
				<c:out value="${department.orders}"></c:out>
			</td>
		</tr>
		</c:forEach>
	</tbody>
</table>
<jsp:include page="/common/pager.jsp" />
</div>
<br/>